define(function(require,exports,module) {
	//require('./plug/lazyload_echo');
	//require('./plug/layer/layer');
    require('./plug/swiper.jquery.min');
	var myPub = require('./public'); 
	var oGoods_showTwo = $('.js_goods_showTwo');	//并排产品
	var oShowBusiness = $('.js_ShowBusiness');		//商家简介查看更多
	var oBusiness_intro = $('.js_business_intro');	//商家简介说明
	var oCloseBtn = $('.js_closeBtn');				//遮罩关闭按钮
	
	oShowBusiness.on('click',function() {
		oBusiness_intro.stop().animate({'height':100+'%'},300);
		$('.wrap').addClass('mohu');
	});
	
	oCloseBtn.on('click',function(e) {
		oBusiness_intro.stop().animate({'height':0+'%'},300);
		$('.wrap').removeClass('mohu');
		e.stopPropagation()
	})
	
	//产品懒加载  异步加载 调用这个
    myPub.lazLoadingImgEcho();
	myPub.SetImgHeight(oGoods_showTwo);
   
   
   	
	var styleTitle = 'width:100%;  border:none';
   	var _sBossInfo= $('.js_bossInfo');
   	var _BossName = $('.js_bossName').text();  
    
    $('.js_contactBoss').on('click',function(e) {
		 myPub.TipTitleLayer('联系商家： '+_BossName,styleTitle, _sBossInfo.html(),function() {
	      	 _sBossInfo.hide();
	   	});
		e.stopPropagation()
	});

    // 添加商家优惠券领取用法
    var oSellerCoupon = $('.js_sellerCoupon').find('.js_sellerCon');
    var dbTapOff = true;                                         // 阻止多次点击
    var time_tapOff;                                             // 定时器
    if(oSellerCoupon.length > 0){
        oSellerCoupon.each(function () {
            $(this).on('click',function () {
                if(dbTapOff){
                    dbTapOff = false;
                    //异步领取优惠券
                        var couponId = $(this).attr("couponId");
                        G_JSON_GET("/coupon/drawSupplierCoupon", {"couponId": couponId}, function (data) {
                            if (data.status ==="success"){
                                myPub.TipLayer(data.message,'no',function () {},2)
                            }else {
                                myPub.TipLayer(data.message,'no',function () {},2)
                            }
                        });
                }
                clearTimeout(time_tapOff);
                time_tapOff = setTimeout(function () {
                    dbTapOff = true;
                }, 500)
            });
        })
    }


    var mySwiper = new Swiper('.js_sellerCoupon',{
        freeMode : true,
        freeModeMomentumRatio: 0.5,
        observer: true,
        observeParents: true,
        slidesPerView : 'auto',
        lazyLoading: true,
        watchSlidesProgress: true,
        watchSlidesVisibility : true
    })
});